Analysis of the Survey

Refinements in Java - Syntax

The survey aimed to assess the best syntax for the implementation of Refinement Types in Java.

Refinement types have been proposed as an incremental approach for program verification that is directly embedded in the programming language. We propose the usage of Refinement Types within the Java programming language not only as a means for program verification but also for fault localization and efficient mutation in the context of software repair.

The survey was open for 7 weeks and had a total of 53 answers which will be analysed in thoughout this document.

1. Background Information - Familiarity with tools

This section aims to understand the background of respondents of the survey.

1.1 Familiarity with Java

Once the survey aims to access the best syntax for the usage of Refinements in Java it is important that the respondents have some familiarity with the language, otherwise the answers may not be demonstrative of the population that uses Java and that might use the Refinements for Java.

The chart above shows that some respondents marked the option "Not familiar" with Java which raises the question if these answers should be used in the study. To access this, we can analyse the other familiarity answers of these respondents.

The 5.7% of respondants not familiar with Java correspond to 3 of the answers of the survey. Once the aim of this study is to evaluate the best syntax to integrate refinement types in the Java language, the answers with no background on Java will be dircarded.

Moreover, from these three answers, two marked the remaining background questions as "Not Familiar" which confirms that the responders are not inserted in the target population.

1.2 Familiarity with Functional Languages

The first implementations of Refinement Types were developed in functional languages. In this survey, some of the proposed syntaxes follow similar lines to other implementations of refinements types, hence, have some similarities to functional languages syntaxes.

1.3 Familiarity with JML

Java Modeling Language is a specification language created for Java.

With the addition of the refinements we are also adding specifications to Java code, which means that the syntax chosen will serve as a specification language.

1.4 Familiarity with Refinement Types

From this point on when a responder is identified as familiar with a tool/concept they can have answered Familiar or Very Familiar in the background questions.

It is expected that the responders that are familiar with Refinement Types are also familiar with functional languages once most of the implementations of refinements types are developed in functional languages. The next diagram confirms this expectation, once all but 1 of the reponders familiar with refinements types are also familiar with functional languages.

From the responders familiar with Refinement Types, two of them are also familiar with JML which is interesting once both have different contributions to program verification. However most of the reponders familiar with JML are not familiar with refinement types and vice-versa.

2. Preferences on the Syntax

2.1 Wildcard Variable

From the gathered answers the first option can be discarded as a possible syntax due to the high rate of "Not Acceptable" answers compared to the others.

To choose between the second and the third options, a more detailed approach needs to be taken.

The "?" option has the lowest rate of "Not Acceptable" and the highest rate of "Acceptable" but contains less "Preferable" answers than the "_" option. While the 3rd option has an higher rate of "Not Acceptable" answers, a lower rate of "Acceptable" ones and the highest number of "Preferable". This leads to an inconclusive answers to which option should be used in the refinements.

To differentiate the last two approaches, it was decided analyse the sideffects of removing the answers that marked the first option(already excluded) as "Preferable". The remotion effects are shown in the plot below.

Without counting with the answers that prefered the 1st option, the rate of "Not Acceptable" answers is the same for the 2nd and 3rd options, while the "Preferable" rate stays the same.

This leads to the choice of _ as the Wildcard Variable.

2.2 Variable Refinements

From this answers we can conclude that the first option was the preferable one. Although, it is possible to see that the second option was also acceptable, and the rate of "Not Acceptable" answers was quite low in both options.

This leads to the choice of the first option as the Syntax for the Refinements in Variables.

2.3 Refinements in Methods

This answers show a preference for the first syntax over the second, once the first has an higher rate of "Preferable" answers and a lower rate of "Not Acceptable" answers.

By this analysis the chosen option is the first one.

2.4 Refinement Alias

For the alising of refinements, the second option shows the best answers, once it has the lowest number of "Not Acceptable" answers and the highest of "Preferable" ones.

This concludes that the second option is the chosen for the refinement alias.

2.5 Ghost/Uninterpreted Functions

The second choice is a clear choice for the positioning of the ghost functions, once it obtained the lowest number of "Not Acceptable" answers and the highest number of "Preferable" answers.

The chosen option for the ghost functions is the second one.

3. Other considerations

3.1 Refinements inspired in Functional Languages and Responders Answers

Along this survey there were two refinements options strongly inspired by the syntax used in functional languages and in refinements for functional languages - specifically LiquidHaskell:

In this subsection we try to evaluate if the background of familiarity with functional languages is linked to the preference on each of this syntaxes. For this we select a total of 26 answers out of the 50 used throughout the study.

3.1.1 Refinements in Variables

There is no clear difference between the responders that are acquainted with functional languages and the global sample once both graphics show similar results and a preference for the first option.

However we can see that all the answers that mark the first option as Not Acceptable are from responders that are familiar with functional languages and that prefered the second option.

3.1.2 Refinements in Methods

Again, the results of the responders acquainted with Functional Languages are similar to the global sample. In the charts above we can see that the bars follow a similar distribution of answers from the reponders familiar and not familiar with functional languages.

Conclusion

Neither of the cases strongly inspired by functional languages show a discrepancy between the total of responders and the responders familiar with Functional Languages, which leads to the conclusion that there the familiarity with functional languages was not a big influence in the choices of the syntax.

3.2 Further Comparison between Background and Answers

3.2.1 Pair Plot - Familiarity with Java and answers
3.2.2 Pair Plot - Familiarity with Functional Languages and Answers
3.2.3 Pair Plot - Familiarity with JML and Answers
3.2.4 Pair Plot - Familiarity with Refinements and Answers

4. Final Comments

This section includes some comments considered interesting.